Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Refactor NimBLEAddress - use NimBLE core representation. #699

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Jul 12, 2024

This simplifies the NimBLEAddress code by directly using the NimBLE core ble_addr_t type to hold the address and allows using NimBLE core functions and macros to replace code in some methods.

  • getNative() replaced with getBase() and now returns const ble_addr_t instead of a pointer to the address value.
  • Adds isNrpa() method to test if an address is random non-resolvable.
  • Adds isStatic() method to test if an address is random static.
  • Adds isPublic() method to test if an address is a public address.
  • Adds isNull() methods to test if an address is NULL.
  • equals() method and == operator will now also test if the address types are the same.
  • Code cleanup.

@h2zero h2zero force-pushed the refactor-nimbleaddress branch 4 times, most recently from f459e51 to f777f8d Compare July 18, 2024 01:42
This simplifies the NimBLEAddress code by directly using the NimBLE core `ble_addr_t` type to hold the address
and allows using NimBLE core functions and macros to replace code in some methods.

* `getNative()` replaced with `getBase()` and now returns a pointer to `const ble_addr_t` instead of a pointer to the address value.
* Adds `isNrpa()` method to test if an address is random non-resolvable.
* Adds `isStatic()` method to test if an address is random static.
* Adds `isPublic()` method to test if an address is a public address.
* Adds `isNull()` methods to test if an address is NULL.
* Adds `getValue()` method which returns a read-only pointer to the address value.
* Adds `reverseByteOrder()` method which will reverse the byte order of the address value.
* `equals()` method and == operator will now also test if the address types are the same.
* Code cleanup.
@h2zero h2zero merged commit 6848d27 into master Jul 18, 2024
31 of 62 checks passed
@h2zero h2zero deleted the refactor-nimbleaddress branch July 18, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant